gtk_css_section_new
gtk_css_section_ref
gtk_css_section_unref
+gtk_css_section_print
+gtk_css_section_to_string
gtk_css_section_get_file
gtk_css_section_get_parent
gtk_css_section_get_start_location
#include "gtkcssinheritvalueprivate.h"
#include "gtkcssinitialvalueprivate.h"
#include "gtkcssnumbervalueprivate.h"
-#include "gtkcsssectionprivate.h"
#include "gtkcssshorthandpropertyprivate.h"
#include "gtkcssstaticstyleprivate.h"
#include "gtkcssstringvalueprivate.h"
#include "gtkcssnodeprivate.h"
#include "gtkcssanimatedstyleprivate.h"
-#include "gtkcsssectionprivate.h"
#include "gtkcssstylepropertyprivate.h"
#include "gtkintl.h"
#include "gtkmarshalers.h"
#include "gtkcsscolorvalueprivate.h"
#include "gtkcsskeyframesprivate.h"
#include "gtkcssparserprivate.h"
-#include "gtkcsssectionprivate.h"
+#include "gtkcsssection.h"
#include "gtkcssselectorprivate.h"
#include "gtkcssshorthandpropertyprivate.h"
#include "gtksettingsprivate.h"
0,
TRUE))
{
- char *s = _gtk_css_section_to_string (section);
+ char *s = gtk_css_section_to_string (section);
g_warning ("Theme parsing error: %s: %s",
s,
#include "config.h"
-#include "gtkcsssectionprivate.h"
+#include "gtkcsssection.h"
#include "gtkcssparserprivate.h"
#include "gtkprivate.h"
return §ion->end_location;
}
+/**
+ * gtk_css_section_print:
+ * @section: a section
+ * @string: a #GString to print to
+ *
+ * Prints the @section into @string in a human-readable form. This
+ * is a form like `gtk.css:32:1-23` to denote line 32, characters
+ * 1 to 23 in the file gtk.css.
+ **/
void
-_gtk_css_section_print (const GtkCssSection *section,
- GString *string)
+gtk_css_section_print (const GtkCssSection *section,
+ GString *string)
{
if (section->file)
{
}
g_string_append_printf (string, ":%zu:%zu",
- section->end_location.lines + 1,
- section->end_location.line_chars + 1);
+ section->start_location.lines + 1,
+ section->start_location.line_chars + 1);
+ if (section->start_location.lines != section->end_location.lines ||
+ section->start_location.line_chars != section->end_location.line_chars)
+ {
+ g_string_append (string, "-");
+ if (section->start_location.lines != section->end_location.lines)
+ g_string_append_printf (string, "%zu:", section->end_location.lines + 1);
+ g_string_append_printf (string, "%zu", section->end_location.line_chars + 1);
+ }
}
+/**
+ * gtk_css_section_to_string:
+ * @section: a #GtkCssSection
+ *
+ * Prints the section into a human-readable text form using
+ * gtk_css_section_print().
+ *
+ * Returns: (transfer full): A new string.
+ **/
char *
-_gtk_css_section_to_string (const GtkCssSection *section)
+gtk_css_section_to_string (const GtkCssSection *section)
{
GString *string;
gtk_internal_return_val_if_fail (section != NULL, NULL);
string = g_string_new (NULL);
- _gtk_css_section_print (section, string);
+ gtk_css_section_print (section, string);
return g_string_free (string, FALSE);
}
GDK_AVAILABLE_IN_ALL
void gtk_css_section_unref (GtkCssSection *section);
+GDK_AVAILABLE_IN_ALL
+void gtk_css_section_print (const GtkCssSection *section,
+ GString *string);
+GDK_AVAILABLE_IN_ALL
+char * gtk_css_section_to_string (const GtkCssSection *section);
+
GDK_AVAILABLE_IN_ALL
GtkCssSection * gtk_css_section_get_parent (const GtkCssSection *section);
GDK_AVAILABLE_IN_ALL
+++ /dev/null
-/* GTK - The GIMP Toolkit
- * Copyright (C) 2011 Red Hat, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#ifndef __GTK_CSS_SECTION_PRIVATE_H__
-#define __GTK_CSS_SECTION_PRIVATE_H__
-
-#include "gtkcsssection.h"
-
-#include "gtkcssparserprivate.h"
-
-G_BEGIN_DECLS
-
-void _gtk_css_section_print (const GtkCssSection *section,
- GString *string);
-char * _gtk_css_section_to_string (const GtkCssSection *section);
-
-G_END_DECLS
-
-#endif /* __GTK_CSS_SECTION_PRIVATE_H__ */
#include "gtkcssinheritvalueprivate.h"
#include "gtkcssinitialvalueprivate.h"
#include "gtkcssnumbervalueprivate.h"
-#include "gtkcsssectionprivate.h"
#include "gtkcssshorthandpropertyprivate.h"
#include "gtkcssstringvalueprivate.h"
#include "gtkcssstylepropertyprivate.h"
#include "gtkcssinitialvalueprivate.h"
#include "gtkcssnumbervalueprivate.h"
#include "gtkcssrgbavalueprivate.h"
-#include "gtkcsssectionprivate.h"
+#include "gtkcsssection.h"
#include "gtkcssshorthandpropertyprivate.h"
#include "gtkcssstringvalueprivate.h"
#include "gtkcssfontfeaturesvalueprivate.h"
if (section)
{
g_string_append (string, " /* ");
- _gtk_css_section_print (section, string);
+ gtk_css_section_print (section, string);
g_string_append (string, " */");
}
#include "gtk/gtkwidgetprivate.h"
#include "gtkcssproviderprivate.h"
#include "gtkcssstylepropertyprivate.h"
-#include "gtkcsssectionprivate.h"
+#include "gtkcsssection.h"
#include "gtkcssstyleprivate.h"
#include "gtkcssvalueprivate.h"
#include "gtkcssselectorprivate.h"
section = gtk_css_style_get_section (new_style, i);
if (section)
- location = _gtk_css_section_to_string (section);
+ location = gtk_css_section_to_string (section);
else
location = NULL;
}